targetted_decisions = { 

	renounce_child = {
		
		filter = dynasty
		ai_target_filter = dynasty
		
		from_potential = {
			is_ruler = yes
			is_republic = no
			OR {
				NOT {
					religion_group = christian
				}
				AND {
					is_priest = no
					is_theocracy = no
				}
			}
			NOT = {
				religion_group = indian_group
			}
		}
		potential = {
			AND = {
				ai = yes
				age = 12
				OR = {
					prisoner = no
					is_abroad = yes
				}
			}
			OR = {
				AND = {
					is_child_of = FROM
					dynasty = FROM
				}
				AND = {
					is_tribal = yes
					is_landed = no
					dynasty_head = {
						character = FROM
						is_tribal = yes
						NOT = {
							religion_group = christian
						}
						OR = {
							is_older_than = ROOT
							religion_group = muslim
						}
					}
				}
				AND = {
					is_tribal = yes
					trait = decadent
					dynasty_head = {
						character = FROM
						is_tribal = yes
						religion_group = muslim
					}
				}
			}
		}

		allow = {
			FROM = {
				is_adult = yes
				prisoner = no
				NOT = {
					trait = incapable
				}
				piety = 500
				prestige = 250
				OR = {
					is_foe = ROOT
					is_rival = ROOT
					ROOT = {
						religion_group = muslim
						trait = decadent
					}
					any_friend = {
						OR = {
							is_foe = ROOT
							is_rival = ROOT
						}
					}
				}
			}
		}

		effect = {
			hidden_tooltip = {
				ROOT = {
					set_character_flag = dinasty_renounced_child
					set_father = 0
					set_mother = 0
					if = {
						limit = {
							is_landed = no
							FROM {
								is_liege_of = ROOT
							}
						}
						banish = yes
					}
					character_event = {
						id = dyn_isolation.2
						days = 2
					}
					character_event = {
						id = dyn_isolation.6
						days = 1
					}
				}
			}
			FROM = {
				recalc_succession = yes
				if = {
					limit = {
						is_tribal = yes
						NOT {
							religion_group = muslim
						}
					}
					prestige = -250
				}
				if = {
					limit = {
						is_tribal = yes
						religion_group = muslim
					}
					piety = -250
				}
				if = {
					limit = {
						is_tribal = no
					}
					piety = -500
				}
				any_courtier {
					if = {
						limit = {
							religion_group = christian
							is_priest = yes
							is_landed = no
						}
						opinion = {
							modifier = renounce_child_priets_opinion
							who = FROM
						}
					} 
				}
				any_vassal = {
					if = {
						limit = {
							religion_group = christian
							OR {
								is_priest = yes
								is_theocracy = yes
							}
							is_landed = yes
						}
						opinion = {
							modifier = renounce_child_priets_opinion
							who = FROM
						}
					} 
				}
				any_dynasty_member = {
					opinion = {
						modifier = renounce_child_dynasty_opinion
						who = FROM
					}
				}
				any_ward = {
					if = {
						limit = {
							NOT {
								dynasty = FROM
								is_child_of = FROM
							}
						}
						opinion = {
							modifier = renounce_child_dynasty_opinion
							who = FROM
						}
					}
				}
				any_child = {
					if = {
						limit = {
							NOT {
								dynasty = FROM
							}
						}
						opinion = {
							modifier = renounce_child_dynasty_opinion
							who = FROM
						}
					}
				}
				ROOT = {
					opinion = {
						modifier = renounce_child_opinion
						who = FROM
					}
				}
			}
		}

		ai_will_do = {
			factor = 1
		}

	}
	
	renounce_prisoned_child = {
		
		filter = home_court
		ai_target_filter = home_court
		
		from_potential = {
			is_ruler = yes
			is_republic = no
			OR = {
				NOT = { religion_group = christian }
				AND = {
					is_priest = no
					is_theocracy = no
				}
			}
			NOT = { religion_group = indian_group }
		}
		potential = {
			AND = {
				age = 12
				prisoner = yes
			}
			OR = {
				FROM = {
					is_father = ROOT
					dynasty = ROOT
				}
				ROOT = {
					is_tribal = yes
					is_landed = no
					dynasty_head = {
						character = FROM
						is_tribal = yes
						NOT = {
							religion_group = christian
						}
						OR = {
							is_older_than = ROOT
							religion_group = muslim
						}
					}
				}
			}
		}

		allow = {
			FROM = {
				is_adult = yes
				prisoner = no
				NOT = { trait = incapable }
				piety = 500
				prestige = 250
			}
		}

		effect = {
			hidden_tooltip = {
				ROOT = {
					set_character_flag = dinasty_renounced_child
					set_father  = 0
					set_mother  = 0
					banish = yes
					character_event = {
						id = dyn_isolation.2
						days = 2
					}
					character_event = {
						id = dyn_isolation.6
						days = 1
					}
				}
			}
			FROM = {
				recalc_succession = yes
				if = {
					limit = {
						is_tribal = yes
						NOT {
							religion_group = muslim
						}
					}
					prestige = -250
				}
				if = {
					limit = {
						is_tribal = yes
						religion_group = muslim
					}
					piety = -250
				}
				if = {
					limit = {
						is_tribal = no
					}
					piety = -500
				}
				any_courtier = {
					if = {
						limit = {
							religion_group = christian
							is_priest = yes
							is_landed = no
						}
						opinion = {
							modifier = renounce_child_priets_opinion
							who = FROM
						}
					} 
				}
				any_vassal = {
					if = {
						limit = {
							religion_group = christian
							OR {
								is_priest = yes
								is_theocracy = yes
							}
							is_landed = yes
						}
						opinion = {
							modifier = renounce_child_priets_opinion
							who = FROM
						}
					} 
				}
				any_dynasty_member = {
					opinion = {
						modifier = renounce_child_dynasty_opinion
						who = FROM
					}
				}
				any_ward = {
					if = {
						limit = {
							NOT {
								dynasty = FROM
								is_child_of = FROM
							}
						}
						opinion = {
							modifier = renounce_child_dynasty_opinion
							who = FROM
						}
					}
				}
				any_child = {
					if = {
						limit = {
							NOT {
								dynasty = FROM
							}
						}
						opinion = {
							modifier = renounce_child_dynasty_opinion
							who = FROM
						}
					}
				}
				ROOT = {
					opinion = {
						modifier = renounce_child_opinion
						who = FROM
					}
				}
			}
		}

		ai_will_do = {
			factor = 1
		}

	}

}
